function openTab(targetId, url, title, role){
	if(role == null || role == '')
		role = 0;
	if(targetId != null && targetId != ''){
		if (Ext.getCmp('maintabs-id').getItem(targetId) != null) {
			Ext.getCmp('maintabs-id').getItem(targetId).show();
		}else{
			Ext.getCmp('maintabs-id').add(FormUtils.createForm("return " + targetId + "('" + targetId  + "', '" + url + "', {crudaction : \"search\", pg4_offset : 0, maxPageItems : 10}, '" + title+ "', '"+role+"')")).show();
		}
	}
}


function actionSubmit(url,param){
	 document.getElementById("exportForm").action=url;
	 var form=document.getElementById("exportForm");
		if(typeof param !='undefined'){
			for (x in param)
			{
				var element = document.createElement('input');
				element.name=x;
				element.value=param[x];
				document.getElementById("exportForm").appendChild(element);
			}
		}
		document.getElementById("exportForm").submit();
}